import Request from '@/utils'
import {request} from '@@/plugin-request/request'

const base_api = '/admin/system/index'

export const getCaptcha = () => {
  return request(`${base_api}/generateValidateCode`,{
    method: 'get',
  })
}

export const login = (params) => {
  return request(`${base_api}/login`,{
    method: 'post',
    data: params,
  })
}

export const getUserInfo = () => {
  return Request({
    url: `${base_api}/getUserInfo`,
    method: 'get',
  })
}

export const logout = () => {
  return Request({
    url: `${base_api}/logout`,
    method: 'get',
  })
}

export const changePassword = (params) => {
  return Request({
    url: `/admin/system/sysUser/changePassword`,
    method: 'put',
    data: params,
  })
}

export const getRoleId = () => {
  return Request({
    url: `${base_api}/getRoleId`,
    method: 'post',
  })
}
